/********************************************************************************
* @file    I2C.h
* @author  
* @version 
* @date    
* @brief   This file contains all functions prototype and macros for the i2C peripheral.
******************************************************************************
* @attention
* <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
*******************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _H_SERAL_FILE_
#define _H_SERAL_FILE_

/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"

/* Configurable parameters-------------------------------------------------------*/

/* Exported types ------------------------------------------------------------*/

/* Exported macro ------------------------------------------------------------*/
#ifdef STM8S207
#define theUART_Init			UART1_Init
#define theUART					UART1
#define theUART_SR_TXE			UART1_SR_TXE
#define theUART_WORDLENGTH_8D	UART1_WORDLENGTH_8D
#define theUART_STOPBITS_1		UART1_STOPBITS_1
#define theUART_PARITY_NO		UART1_PARITY_NO
#define theUART_SYNCMODE_CLOCK_DISABLE	UART1_SYNCMODE_CLOCK_DISABLE
#define theUART_MODE_TXRX_ENABLE		UART1_MODE_TXRX_ENABLE
#else
#define theUART_Init			UART2_Init
#define theUART					UART2
#define theUART_SR_TXE			UART2_SR_TXE
#define theUART_WORDLENGTH_8D	UART2_WORDLENGTH_8D
#define theUART_STOPBITS_1		UART2_STOPBITS_1
#define theUART_PARITY_NO		UART2_PARITY_NO
#define theUART_SYNCMODE_CLOCK_DISABLE	UART2_SYNCMODE_CLOCK_DISABLE
#define theUART_MODE_TXRX_ENABLE		UART2_MODE_TXRX_ENABLE
#endif

/* Exported variables --------------------------------------------------------*/



/* Exported functions --------------------------------------------------------*/
void InitUSART(u32 baud);
void sendUSART(unsigned char c);
u8 receiveUSART(unsigned char* c);

#endif /* I2C */

/******************* (C) MITIANSHENYU *****END OF FILE****/

